﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

namespace OAuthLoginSample.Views
{
    public partial class FacebookWebLoginResultView : PhoneApplicationPage
    {
        public FacebookWebLoginResultView()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            string id;
            string name;
            string picture;

            NavigationContext.QueryString.TryGetValue("id", out id);
            NavigationContext.QueryString.TryGetValue("name", out name);
            NavigationContext.QueryString.TryGetValue("picture", out picture);

            UserName.Text = name;
            UserId.Text = id;
            ProfilePicture.Source = new BitmapImage(new Uri(picture)); ;
        }
    }
}